configure_file(daemon.conf ${CMAKE_CURRENT_BINARY_DIR}/daemon.conf @ONLY)
configure_file(get_version.sh ${CMAKE_CURRENT_BINARY_DIR}/get_version.sh @ONLY)
configure_file(install.sh ${CMAKE_CURRENT_BINARY_DIR}/install.sh @ONLY)
configure_file(logrotate.conf ${CMAKE_CURRENT_BINARY_DIR}/logrotate.conf @ONLY)
configure_file(rsyslog.conf ${CMAKE_CURRENT_BINARY_DIR}/rsyslog.conf @ONLY)
configure_file(uninstall.sh ${CMAKE_CURRENT_BINARY_DIR}/uninstall.sh @ONLY)
configure_file(ProductSection.json ${CMAKE_CURRENT_BINARY_DIR}/ProductSection.json @ONLY)

#添加可执行权限
execute_process(COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/install.sh)
execute_process(COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/uninstall.sh)
execute_process(COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/get_version.sh)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/daemon.conf DESTINATION .)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/get_version.sh DESTINATION .)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/install.sh DESTINATION .)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/logrotate.conf DESTINATION .)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/rsyslog.conf DESTINATION .)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/uninstall.sh DESTINATION .)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ProductSection.json DESTINATION .)

install(FILES egw_db-20210707.db DESTINATION bin)
install(FILES egw_config.json DESTINATION bin)
install(FILES DataCenter.zconf DESTINATION .)